package com.baize.glinkad.bean.listener;

import com.baize.glinkad.bean.ADType;
import com.baize.glinkad.bean.Action;
import com.baize.glinkad.manager.ADManagerFactory;
import com.baize.glinkad.utils.net.ADReport;

public class BannerCallBack implements BannerListener {
    public BannerListener listener = null;

    public BannerCallBack(BannerListener bannerListener) {
        this.listener = bannerListener;
    }

    @Override
    public void onClicked() {
        BannerListener bannerListener = this.listener;
        if (bannerListener != null) {
            bannerListener.onClicked();
        }
        ADReport.report(ADManagerFactory.instance().context,ADManagerFactory.instance().glinkAD.glinkConfig.getAppId(),ADManagerFactory.instance().glinkAD.posID, ADType.BANNER, Action.CLICK);
    }

    @Override
    public void onClose() {
        BannerListener bannerListener = this.listener;
        if (bannerListener != null) {
            bannerListener.onClose();
        }
        ADReport.report(ADManagerFactory.instance().context,ADManagerFactory.instance().glinkAD.glinkConfig.getAppId(),ADManagerFactory.instance().glinkAD.posID, ADType.BANNER, Action.CLOSE);
    }

    @Override
    public void onFail(String str, String str2) {
        BannerListener bannerListener = this.listener;
        if (bannerListener != null) {
            bannerListener.onFail(str, str2);
        }
    }

    @Override
    public void onReady() {
        BannerListener bannerListener = this.listener;
        if (bannerListener != null) {
            bannerListener.onReady();
        }
        ADReport.report(ADManagerFactory.instance().context,ADManagerFactory.instance().glinkAD.glinkConfig.getAppId(),ADManagerFactory.instance().glinkAD.posID, ADType.BANNER, Action.READY);
    }

    @Override
    public void onShow() {
        BannerListener bannerListener = this.listener;
        if (bannerListener != null) {
            bannerListener.onShow();
        }
        ADReport.report(ADManagerFactory.instance().context,ADManagerFactory.instance().glinkAD.glinkConfig.getAppId(),ADManagerFactory.instance().glinkAD.posID, ADType.BANNER, Action.SHOWED);
    }

}
